home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / BASIC / LIB / EVENTSHELL / DATALOAD / !DataLoad / !DataLoad (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1996-01-07  |  5KB  |  111 lines

  1.  > <DataLoad$Dir>.!DataLoad
  2. $;" at line "+
  3. debugging%=
  4.  Copyright Paul Hobbs 1990,1991,1992,1993,1995
  5.  Rheinpfalzstrasse 2
  6.     85049 Ingolstadt
  7.              Germany
  8.  "<EvntShell$Path>ShellLibRT"
  9. shell_FatalError
  10.  "Hourglass_On"
  11.  "Wimp_SlotSize",-1,-1 
  12.  progsize%
  13. pagesize%=1<<10
  14. freespace%=&8000+progsize%
  15. =freespace%+pagesize%
  16. =freespace%
  17. shell_HeapManagerInit("<EvntShell$Path>",freespace%)
  18. shell_Init
  19.  pass 310 as version nr to allow menu messaging..
  20. 5task% = 
  21. shell_WimpInit_I( 310, "DataLoad Demo" )
  22.  PROCshell_TraceInit( "" )
  23.  PROCshell_TraceOn
  24. shell_ResourcesInit
  25. app_init
  26.  -------------------- Initialise Variables ----------------------------
  27. $G_closedown%     =
  28.  Set this to TRUE when you want the program to
  29. %!                       :
  30.  -------------------- Miscelleanous Initialisation --------------------
  31.  "Hourglass_Off"
  32. shell_Error
  33. shell_Action(
  34. shell_Poll_I( 0, task% ) )
  35.  _closedown%
  36. shell_Exit:
  37.  ======================================================================
  38. app_init
  39. SetUp_Menus
  40. 8_sicon=
  41. shell_Iconbar( -1, "!" + 
  42. shell_GetAppName, "" , 120, MenuHandle_IconBar%, 0 ,0 ,0 )
  43. shell_AttachHelpTag( -1, sicon, "iconbar" )
  44. shell_AttachClickSelect( -1, sicon, "_ClickSelect_ibar" )
  45. shell_AttachDataLoad( -1, sicon, &FFF, "_dataloadFFF", -1)
  46. shell_AttachDataLoad( -1, sicon, &200, "_dataload200", 
  47. shell_CreateWindowStatic( "mainw", mainw% )
  48.  attach dataload event to icon 0 in main window..
  49. shell_AttachDataLoad(mainw%,0,&FEC,"_dataloadFEC",
  50.  attach dataload event to icon 10 in main window, this one handles
  51.  any file/directory etc dragged to it..
  52. shell_AttachDataLoad(mainw%,10,-1,"_dataload_any",
  53.  ===== Menu_Setup routines ======================================
  54. SetUp_Menus
  55.  void%
  56. NEMenuHandle_IconBar% = 
  57. shell_MenuNew( "DataLoad", "Menu_IBar", 2)
  58. O9MenuItem_Info%      = 
  59. shell_MenuAdd( 0, "Info", "" )
  60. PIMenuItem_Quit%      = 
  61. shell_MenuAdd( 0, "Quit", "_MenuSelect_Quit" )
  62. shell_AttachMenuDBox( MenuItem_Info%, "progInfo", "_PreOpenInfo", "" )
  63. shell_AttachMenuHelpTag( "Menu_IBar", MenuItem_Quit%, "menutest2" )
  64. shell_AttachMenuHelpTag( "Menu_IBar", MenuItem_Info%, "menutest"  )
  65.  ===== Dialog_PreOpen routines ==================================
  66. _PreOpenInfo(wh%)
  67. shell_IconPutData(wh%,0,
  68. shell_MessageNoArgs("progInfo0"),0)
  69. shell_IconPutData(wh%,1,
  70. shell_MessageNoArgs("progInfo1"),0)
  71. shell_IconPutData(wh%,2,
  72. shell_MessageNoArgs("progInfo2"),0)
  73. shell_IconPutData(wh%,3,
  74. shell_MessageNoArgs("progInfo3"),0)
  75.  ===== Dialog_PostOpen routines =================================
  76.  ===== Click_Select routines ====================================
  77. _ClickSelect_ibar(wh%,ih%)
  78. shell_OpenWindowStatic(mainw%)
  79.  ===== Click_Adjust routines ====================================
  80.  ===== Menu_Select routines =====================================
  81. _MenuSelect_Quit(blk%)
  82. _closedown%=
  83.  ===== Data_Load routines =======================================
  84. _dataload200(loc%,type%,name$,size%)
  85.  void%
  86.  pick up location of loaded file....
  87. zjvoid%=
  88. shell_MessageWindow("File loaded at &"+
  89. ~loc%+" Type=&"+
  90. ~type%+" '"+name$+"'",0,"DataLoad","")
  91. _dataloadFFF(loc%,type%,name$,size%)
  92.  void%
  93.  pick up location of loaded file....
  94. Qvoid%=
  95. shell_MessageWindow("File '"+name$+"' Type=&"+
  96. ~type%,0,"DataLoad","")
  97. _dataloadFEC(loc%,type%,name$,size%)
  98.  just display a message - user app must actually load file here..
  99. Qvoid%=
  100. shell_MessageWindow("File '"+name$+"' Type=&"+
  101. ~type%,0,"DataLoad","")
  102. _dataload_any( loc%, type%, name$, size% )
  103.  just put the filename in the icon...
  104. shell_IconPutData( mainw%, 10, name$, 
  105. shell_IconPutData( mainw%, 13, "&" + 
  106. ~type%, 
  107.  ===== Data_Save routines =======================================
  108.  ===== Application routines =====================================
  109.  ===== End of user application ==================================
  110.  =================== Routines to go in the library ==================
  111.